<%@ page pageEncoding="utf-8" import="java.util.*" %>
<%@ page import="DoMain.Student" %>
<%@ page import="DoMain.CriteriaStudent" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

    <title>晚归登记的学生</title>
    <script type="text/javascript" src="script/jquery-3.3.1.js"></script>
    <script type="text/javascript">

		$(function(){
			
			$(".delete").click(function(){
				
				var content=$(this).parent().parent().find("td:eq(1)").text();
				var flag=confirm("确定要删除"+content+"的信息吗？");
				
				return flag;
				
			});	
		});
</script>
  </head>
  <body>

  <a href="query.So">查看</a><br>
  <a href="queryStudent.So">点击返回继续登记</a>
  
  <%	List<Student> students=(List<Student>)request.getAttribute("students"); %>
  
  
  
  <table class="table table-hover">

    <tr class="table-primary" align="center">
      <th scope="col" align="center">学生学号</th>
      <th scope="col" align="center">学生姓名</th>
      <th scope="col" align="center">性别</th>
      <th scope="col" align="center">班别</th>
      <th scope="col" align="center">楼栋</th>
      <th scope="col" align="center">宿舍号</th>
      <th scope="col" align="center">晚归原因</th>
      <th scope="col" align="center">是否被登记</th>
      <th scope="col" align="center">操作</th>
    </tr>


 			 <c:forEach items="${students}" var="st">
			<tr  class="table-light">
				<td class="table-success" scope="row" align="center">${st.studentNo}</td>
				<td class="table-success" scope="row" align="center">${st.studentName}</td>
				<td class="table-warning" scope="row" align="center">${st.sex}</td>
				<td class="table-warning" scope="row" align="center">${st.className}</td>
				<td class="table-warning" scope="row" align="center">${st.dormName}</td>
				<td class="table-warning" scope="row" align="center">${st.roomNo}</td>
				<td class="table-warning" scope="row" align="center">${st.lateReason}</td>
				<td class="table-warning" scope="row" align="center">${st.regist}</td>
				<td><a align="center" class="delete" href="deleteStudent.So?studentNo=${st.studentNo}">删除</a>
				</td>
			</tr>
			</c:forEach>
  

  	</table>
  </body>
  </html>